import request from '@/utils/request'
import { exportMethod } from '@/utils/utils'
import * as proxy from '@/constants/proxy'

//----------------------------需求申请
// 列表数据
export function getInnovativeTalentTeamList(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/pageList',
        method: 'post',
        data,
    })
}
//根据id获取详情
export function getInnovativeTalentTeamDetail(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/detail`,
        method: 'post',
        data,
    })
}
//新增
export function getAddInnovativeTalentTeam(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/insert',
        method: 'post',
        data,
    })
}
//删除
export function deleteInnovativeTalentTeam(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/batchDelete`,
        method: 'post',
        data
    })
}
//列表批量导出
export function getExportInnovativeTalentTeam(data: any) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/batchExport',
        data: data,
        fileName: '需求申请表',
    }
    return exportMethod(params)
}
export function getExportInnovativeTalentTeam1(data: any, name) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/batchExport',
        data: data,
        fileName: name,
    }
    return exportMethod(params)
}
//修改
export function getUpdateInnovativeTalentTeam(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/update',
        method: 'post',
        data,
    })
}
//提交
export function getInnovativeTalentTeamLock(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/batchSubmit`,
        method: 'post',
        data
    })
}
//---------------------------需求初审
export function getList(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/pageInitAuditList`,
        method: 'post',
        data
    })
}
export function getAuditSuggest(data) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/getAuditSuggest`,
        method: 'post',
        data
    })
}
export function getDetail(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/batchSubmit`,
        method: 'post',
        data
    })
}
//导出
export function getExportFirst(data: any) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/auditBatchExport',
        data: data,
        fileName: '需求初审表',
    }
    return exportMethod(params)
}
//导出
export function getExportFirst1(data: any,name) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/szhxmps/digital-project-need-apply/auditBatchExport',
        data: data,
        fileName: name,
    }
    return exportMethod(params)
}

export function getInnova(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/batchSubmit`,
        method: 'post',
        data
    })
}
//初审通过
export function examineTable(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/auditPass`,
        method: 'post',
        data
    })
}
//初审不通过
export function unexamineTable(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/szhxmps/digital-project-need-apply/auditNotPass`,
        method: 'post',
        data
    })
}
// ---------------------专家评审
// 列表数据 专家评审
export function getExpertReview(params: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/getExpertList',
        method: 'post',
        params,
    })
}
//列表批量导出 专家评审
export function getExportExpertReview(data: any) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/expertExport',
        data: data,
        fileName: '专家评审表',
    }
    return exportMethod(params)
}
//列表批量导出 专家评审
export function getExportExpertReview1(data: any,name) {
    const params = {
        method: 'post',
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/expertExport',
        data: data,
        fileName: name,
    }
    return exportMethod(params)
}
// 设置专家弹窗 列表数据 专家评审
export function getSetUpExpertReview(params: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/getExpertName',
        method: 'post',
        params,
    })
}
// 设置专家弹窗 确认设置
export function addExpertReview(id,data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/xmzx/szxmlxps/projectApplication/insertExpert?id=${id}`,
        method: 'post',
        data
    })
}
// 设置专家 投票票数
export function votesCast(params: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/xmzx/szxmlxps/projectApplication/getExpertConfirmDetail`,
        method: 'post',
        params
    })
}
// 设置专家 投票 进行审批通过or不通过
export function doApprove(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/xmzx/szxmlxps/projectApplication/comfirmExpert`,
        method: 'post',
        data
    })
}
// 设置专家 意见 专家审批通过or不通过
export function opinionApprove(data: any) {
    return request({
        url: proxy.CHECC_API_CMS + `/xmzx/szxmlxps/projectApplication/updateExpert`,
        method: 'post',
        data
    })
}
//------------查看专家初审情况
export function lookResult(params: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/getExpertDetail',
        method: 'post',
        params,
    })
}
//------------详情
export function hadDetail(params: any) {
    return request({
        url: proxy.CHECC_API_CMS + '/xmzx/szxmlxps/projectApplication/getDetailById',
        method: 'post',
        params,
    })
}

